The traditional way for adding functionality to existing executable is for the source code to dynamically import subroutines from a library (e.g. DLL), or to use a static library and link to it through the linking process. These methods require an access to the source code.
Other methods allow the user to call for new functionality during run time—not preparing a new downloadable code.
Other method are about automatically analyzing the source code and adapting it—again, a knowledge and access to the source code are required.